package com.ljq;

import java.util.HashMap;

public class Room {
    private String id;
    private String description;
    private String Monsters;
    private Creature creature;
    private HashMap<String, Room> reachableRooms=new HashMap<>();

    public void addReachableRoom(String roomId,Room room){
        reachableRooms.put(roomId,room);
    }

    public Room searchReachableRoomById (String targetRoomId, HashMap<String,Room> reachableRooms) {
        Room room=null;
        if(true == reachableRooms.containsKey(targetRoomId))
        {
            room=reachableRooms.get(targetRoomId);
        }
        return room;
    }

//    public void addMonster(){
//       Monster monster1 = new Monster();
//       monster1.setCurrentRoom();
//    }
    @Override
    public String toString()
    {
        return this.description;
    }
    public Room() {
    }

    public Room(String id, String description) {
        this.id = id;
        this.description = description;
    }

    public Room(String id, String description, String monsters) {
        this.id = id;
        this.description = description;
        Monsters = monsters;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public HashMap<String, Room> getReachableRooms() {
        return reachableRooms;
    }

    public void setReachableRooms(HashMap<String, Room> reachableRooms) {
        this.reachableRooms = reachableRooms;
    }

    public String getMonsters() {
        return Monsters;
    }

    public void setMonsters(String monsters) {
        Monsters = monsters;
    }

    public Creature getCreature() {
        return creature;
    }

    public void setCreature(Creature creature) {
        this.creature = creature;
    }
}
